import { get, post, put, del, download as downloadFile } from './https.js'
/**
 * ================================
 * 认证相关 API
 * ================================
 */

/** 获取验证码 */
export const captchaImage = () => get('/captchaImage')

/** 用户登录 */
export const login = (data) => post('/pcRyAccount/pcLogin', data)

/**
 * ================================
 * 文件上传 API
 * ================================
 */

/** 图片上传 */
export const uploadImg = (data) => post('/oss/uploadImg', data)

/**
 * ================================
 * 种植管理 API
 * ================================
 */

/** 获取所有种植信息 */
export const findAllLands = (params) => get('/pcRyPlant/findAllLands', params)

/** 获取种植详情 */
export const findFruitTree = (params) => get('/pcRyPlant/findFruitTreeInfoByBatch', params)

/** 获取所有地块(不分页) */
export const findAllLand = () => get('/pcRyPlant/findAllLand')

/** 禁用/编辑地块配置 */
export const compileLandMsg = (data) => put('/pcRyPlant/compilePlantMsg', data)

/** 获取单个地块详细信息 */
export const findLandMsgById = (params) => get('/pcRyLand/findLandMsgById', params)

/** 生成地块二维码 */
export const generateLandQrcode = (params) => get('/pcRyPlant/generateLandQrcode', params, { responseType: 'blob' })

/** 获取地块坐标 */
export const findAllCoords = () => get('/pcRyPlant/findAllLand')

/** 添加地块 */
export const addLand = (data) => post('/pcRyLand/addLand', data)

/**
 * ================================
 * 企业/基地管理 API
 * ================================
 */

/** 获取所有企业 */
export const findAllCompany = () => get('/pcSaas/findAllCompany')

/** 获取指定基地或地块 */
export const findAllBaseSoilByCompanyId = (data) => post('/pcSaas/findAllBaseSoilByCompanyId', data)

/** 获取地块所属批次号 */
export const findAllBatchNumber = (data) => post('/pcSaas/findAllBatchNumberByBaseSoilId', data)

/** 添加基地 */
export const addBase = (data) => post('/pcRyBase/addBase', data)

/**
 * ================================
 * 同步相关 API
 * ================================
 */

/** 同步种植信息 */
export const synchronizationPlantInfo = (data) => post('/pcSaas/synchronizationPlantInfo', data)

/** 同步品种信息 */
export const synchronizationVarietyInfo = () => post('/pcSaas/synchronizationVarietyInfo')

/** 同步投入品信息 */
export const synchronizationVariableInput = () => post('/pcSaas/synchronizationVariableInput')

/** 同步农事操作 */
export const synchronizationOperatorFarm = () => post('/pcSaas/synchronizationOperatorFarm')

/**
 * ================================
 * 租赁/认养管理 API
 * ================================
 */

/** 获取地块租赁信息 */
export const findLeaseRecordByLandId = (params) => get('/pcRyTenancy/findLeaseRecordByLandId', params)

/** 获取所有认养信息 */
export const findAllTenancyMessage = (params) => get('/pcRyTenancy/findAllTenancyMessage', params)

/** 获取单个认养详情 */
export const findTenancyByTenancyIdAndLandId = (params) => get('/pcRyTenancy/findTenancyByTenancyIdAndLandId', params)

/** 获取认养订单详情 */
export const findTenancyDetailByTenancyId = (params) => get('/pcRyTenancy/findTenancyDetailByTenancyId', params)

/** 发货 */
export const deliverGoods = (data) => post('/pcRyTenancy/deliverGoods', data)

/** 根据地块ID查询产出物信息 */
export const findGoodsByLandMsgId = (params) => get('/pcRyTenancy/findGoodsByLandMsgId', params)

/** 查询物流信息 */
export const queryTrack = (params) => get('/pcRyTenancy/queryTrack', params)

/**
 * ================================
 * 品种管理 API
 * ================================
 */

/** 获取所有品种 */
export const findAllVariety = (params) => get('/pcRyVariety/findAllVariety', params)

/** 获取单个品种详情 */
export const findVarietyById = (params) => get('/pcRyVariety/findVarietyById', params)

/** 新增/编辑品种 */
export const addVariety = (data) => post('/pcRyVariety/addVariety', data)

/** 删除品种 */
export const removeVarietyById = (id) => del(`/pcRyVariety/removeVarietyById/${id}`)

/**
 * ================================
 * 农事任务管理 API
 * ================================
 */

/** 获取地块农事情况 */
export const findTaskMsgSByLandMsgId = (params) => get('/pcRyTask/findTaskMsgSByPlantId', params)

/**
 * ================================
 * 订单管理 API
 * ================================
 */

/** 获取全部订单 */
export const getAllOrder = (params) => get('/pcRyTenancy/getAllOrder', params)

/** 取消订单 */
export const cancelPayment = (params) => put('/pcRyTenancy/cancelPayment', {}, { params })

/** 获取收货人信息 */
export const findAddressById = (params) => get('/pcRyUserAddress/findAddressById', params)

/**
 * ================================
 * 投入品管理 API
 * ================================
 */

/** 获取全部投入品 */
export const allVariableInputDetail = (params) => get('/pcRyVariableInput/allVariableInputDetail', params)

/** 获取投入品使用记录 */
export const variableInputUsageRecord = (params) => get('/pcRyVariableInput/variableInputUsageRecord', params)

/** 修改库存 */
export const inventoryAdjust = (data) => put('/pcRyVariableInput/inventoryAdjust', data)

/** 获取所有投入品类别 */
export const findVariableInputType = () => get('/pcRyVariableInput/findVariableInputType')

/** 编辑/添加投入品 */
export const addVariableInput = (data) => post('/pcRyVariableInput/addVariableInput', data)

/**
 * ================================
 * 合同管理 API
 * ================================
 */

/** 查看所有合同 */
export const findSignContractDetail = (params) => get('/pcRyContract/findSignContractDetail', params)

/** 获取合同模板 */
export const findContract = () => get('/pcRyContract/findContract')

/** 下载合同模板 */
export const download = () => post('/pcRyContract/download', {}, { responseType: 'blob' })

/** 查看个人合同模板 */
export const checkContract = (params) => get('/pcRyContract/checkContract', params)

/** 编辑/添加合同模板 */
export const addContract = (data) => post('/pcRyContract/addContract', data)

/**
 * ================================
 * 农事操作管理 API
 * ================================
 */

/** 查询所有农事操作 */
export const findAllFarmOperator = (params) => get('/ryFarmOperator/findAllFarmOperator', params)

/** 查询农事操作详情 */
export const findFarmOperatorById = (params) => get('/ryFarmOperator/findFarmOperatorById', params)

/** 删除农事操作 */
export const delFarmOperatorById = (params) => del('/ryFarmOperator/delFarmOperatorById', params)

/** 编辑/新增农事操作 */
export const addFarmOperator = (data) => post('/ryFarmOperator/addFarmOperator', data)

/** 获取所有操作人 */
export const findAllOperator = () => get('/pcRyAccount/findAllOperator')

/**
 * ================================
 * 人员管理 API
 * ================================
 */

/** 查询所有人员 */
export const findPcAccountByCondition = (params) => get('/pcRyAccount/findPcAccountByCondition', params)

/** 查询单个人员信息 */
export const findPcUserByPcUserId = (params) => get('/pcRyAccount/findPcUserByPcUserId', params)

/** 新增人员 */
export const addPcAccount = (data) => post('/pcRyAccount/addPcAccount', data)

/** 删除人员 */
export const removePcUserById = (params) => del('/pcRyAccount/removePcUserById', params)

/**
 * ================================
 * 部门管理 API
 * ================================
 */

/** 查询所有部门 */
export const findUserdataByDepartmentId = (params) => get('/pcRyAccount/findUserdataByDepartmentId', params)

/** 添加部门 */
export const addDepartment = (data) => post('/pcRyAccount/addDepartment', data)

/**
 * ================================
 * 权限管理 API
 * ================================
 */

/** 查询部门或个人权限 */
export const findResourceByDepartmentIdAndUserId = (params) => get('/pcRyAccount/findResourceByDepartmentIdAndUserId', params)

/** 添加部门或个人权限 */
export const giveDepartmentAndUserAddResource = (data) => post('/pcRyAccount/giveDepartmentAndUserAddResource', data)

/**
 * ================================
 * 设备管理 API
 * ================================
 */

/** 查询所有设备 */
export const findAllEquipmentDetails = (params) => get('/pcRyEquipment/findAllEquipmentDetails', params)

/** 查看二期设备坐标 */
export const findAllEquipment = () => get('/pcSaas/findAllEquipmentInfo')

/** 根据ID删除设备 */
export const delEquipmentById = (params) => del('/pcRyEquipment/delEquipmentById', params)

/** 添加/编辑设备 */
export const addEquipment = (data) => post('/pcRyEquipment/addEquipment', data)



















